package cn.edu.scau.cmi.yanghaorui.hibernate.domain;

public class Student implements java.io.Serializable {

	  private Long id;
	  private String name;
	  private Long number;
	  private Teacher tutor;
	  
	  public Student() {
	  }

	public Student(Long id, String name, Long number, Teacher tutor) {
		//super();
		this.id = id;
		this.name = name;
		this.number = number;
		this.tutor = tutor;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the number
	 */
	public Long getNumber() {
		return number;
	}

	/**
	 * @param number the number to set
	 */
	public void setNumber(Long number) {
		this.number = number;
	}

	/**
	 * @return the tutor
	 */
	public Teacher getTutor() {
		return tutor;
	}

	/**
	 * @param tutor the tutor to set
	 */
	public void setTutor(Teacher tutor) {
		this.tutor = tutor;
	}
	
	//@Override
	public void show() {
		if(tutor!=null) {
			System.out.println ("学号:"+id+"姓名:"+name+"导师:"+tutor.getName());
		}
		else {
			System.out.println ("学号:"+id+"姓名:"+name);
		}
		
	}

	 
	}
